/*
 * @(#)cn.design.pattern.iterator 2020/4/24/0024
 *
 * Copy Right@ 人人译视界
 */


package cn.design.pattern.iterator;

import java.util.Iterator;

/**
 * <pre>
 * @author tuwei
 *
 * @version 0.9
 *
 * 修改版本: 0.9
 * 修改日期: 2020/4/24/0024
 * 修改人 :  tuwei
 * 修改说明: 初步完成
 * 复审人 ：
 * </pre>
 */
public class ComputeCollegeIterator implements Iterator {
	Department[] departments;
	int position = 0;

	public ComputeCollegeIterator(Department[] departments) {
		this.departments = departments;
	}

	@Override
	public boolean hasNext() {
		if (position >= departments.length || departments[position] == null) {
			return false;
		}
		return true;
	}

	@Override
	public Object next() {
		Department department = departments[position];
		position++;
		return department;
	}

	@Override
	public void remove() {

	}
}
